﻿using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
using Infrastructure.ExternalService.Core.Responses;

namespace Infrastructure.ExternalService.Core.FileStorage
{
    /// <summary>
    /// 文件外部服务
    /// </summary>
    public interface IFileStorageExternal
    {
        Task FilePersistentConfirmAsync(FilePersistentConfirmRequest request);

        /// <summary>
        /// 上传Excel文件
        /// </summary>
        /// <param name="request"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        Task<string> FileUploadAsync(FileUploadRequest request, string fileName);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <param name="content"></param>
        /// <param name="fileName"></param>
        /// <returns></returns>
        Task<UploadFile> FileUploadAsync(FileUploadRequest request, ByteArrayContent content, string fileName);

        /// <summary>
        /// 下载文件流
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<Stream> DownloadAsync(DownloadRequest request);

        /// <summary>
        /// 获取文件下载Token
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<DownloadFileToken> DownloadFileTokenAsync(DownloadFileTokenRequest request);
    }
}